package com.helios.mobile.controller;

import java.util.Date;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import com.google.gson.Gson;

/**
 * 首页控制器
 * 
 * @author liyu
 */
@RestController
public class MainController {
	
	@RequestMapping(value = "index.html")
	public ModelAndView toIndex() {
		return new ModelAndView("index");
	}
    
    @RequestMapping(value = "time.json")
    public String getTime(HttpServletRequest request) {
    	return new Gson().toJson(new Date());
    }
 
}
